import { title } from "process"
import { RouteRecordRaw } from "vue-router"

const constantRoutes: RouteRecordRaw[] = [
    {
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录',
            hidden: true
        }
    },
    {
        path: '/',
        component: () => import('@/layout/index.vue'),
        redirect: '/statistics',
        name: 'home',
        meta: {
            hidden: true
        },
        children: [
            {
                path: '/statistics',
                redirect: '/statistics/overall',
                name: 'statistics',
                meta: {
                    title: '收支统计',
                    icon: 'Histogram'
                },
                children: [
                    {
                        path: '/statistics/overall',
                        component: () => import('@/views/statistics/overall/index.vue'),
                        name: 'overall',
                        meta: {
                            title: '收支总览',
                            icon: 'PieChart'
                        }
                    },
                    {
                        path: '/statistics/income',
                        component: () => import('@/views/statistics/income/index.vue'),
                        name: 'income',
                        meta: {
                            title: '收入统计',
                            icon: 'CirclePlusFilled'
                        }
                    },
                    {
                        path: '/statistics/expense',
                        component: () => import('@/views/statistics/expense/index.vue'),
                        name: 'expense',
                        meta: {
                            title: '支出统计',
                            icon: 'RemoveFilled'
                        }
                    },
                    {
                        path: '/statistics/budget',
                        component: () => import('@/views/statistics/budget/index.vue'),
                        name: 'budget',
                        meta: {
                            title: '收支趋势',
                            icon: 'Notebook'
                        }
                    }
                ]

            },
            {
                path: '/recordEditing',
                component: () => import('@/views/recordEditing/index.vue'),
                name: 'recordEditing',
                meta: {
                    title: '收支编辑',
                    icon: 'Edit'
                }
            },
            {
                path: '/elementManagement',
                component: () => import('@/views/elementManagement/index.vue'),
                name: 'elementManagement',
                meta: {
                    title: '元素管理',
                    icon: 'Operation'
                }
            },
            {
                path: '/QA',
                component: () => import('@/views/QA/index.vue'),
                name: 'QA',
                meta: {
                    title: '问答',
                    icon: "Operation"
                }
            }
        ]
    }
]

export default constantRoutes